class IrrigationController {
    constructor() {
        this.irrigationStatus = false;
        this.fertilizerStatus = false;
        this.initializeControls();
    }

    initializeControls() {
        document.getElementById('irrigation-toggle').addEventListener('click', () => {
            this.toggleIrrigation();
        });

        document.getElementById('fertilizer-toggle').addEventListener('click', () => {
            this.toggleFertilizer();
        });
    }

    toggleIrrigation() {
        this.irrigationStatus = !this.irrigationStatus;
        this.updateIrrigationStatus();
    }

    toggleFertilizer() {
        this.fertilizerStatus = !this.fertilizerStatus;
        this.updateFertilizerStatus();
    }

    updateIrrigationStatus() {
        const status = document.getElementById('irrigation-status');
        status.textContent = this.irrigationStatus ? '开启' : '关闭';
        status.style.color = this.irrigationStatus ? '#4CAF50' : '#666';
    }

    updateFertilizerStatus() {
        const status = document.getElementById('fertilizer-status');
        status.textContent = this.fertilizerStatus ? '开启' : '关闭';
        status.style.color = this.fertilizerStatus ? '#4CAF50' : '#666';
    }
} 